package com.chf.job.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConf implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;

    /**
     * 拦截没有登录的请求
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/page/updatePassword.html")
                .addPathPatterns("/page/resume.html")
                .addPathPatterns("/resume/updateResumeName.html")
                .addPathPatterns("/page/resumeOverView.html")
                .addPathPatterns("/page/openServiceFirst.html")
                .addPathPatterns("/page/openService.html")
                .addPathPatterns("/page/addCompanyFirst.html")
                .addPathPatterns("/tag/addTag.html")
                .addPathPatterns("/page/addCompanyTags.html")
                .addPathPatterns("/page/addFounder.html")
                .addPathPatterns("/page/addCompanyIntroduce.html")
                .addPathPatterns("/page/releasePost.html")
                .addPathPatterns("/release/addRelease.html")
                .addPathPatterns("/page/addReleaseSuccess.html")
                .addPathPatterns("/release/getReleaseInfo.html")
                .addPathPatterns("/page/effectivePosition.html")
        .addPathPatterns("/page/untreatedResume.html")
        .addPathPatterns("/page/sendResume.html")
        .addPathPatterns("/page/unseemlinessResume.html")

        ;
    }
}
